using System.Collections.Generic;
using System.Linq;
using YatFram.Browser;
using YatFram.Browser.CssSelector;

namespace Examples.Google
{
    public class SearchResults
    {
        private readonly IContainerElement _searchResults;

        public SearchResults(IContainerElement homepage)
        {
            _searchResults = homepage;
        }

        public IEnumerable<string> Results()
        {
            return _searchResults.Find("a.l".ToCssSelector()).Select(element => element.Attribute("href"));
        }
        
    }
}